var preferencesService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch("answers.");
if (ANSW.version=="1.0") // from webtip1.js
{
ANSW.version="2.3.53"
ANSW.setStringPreference("version",ANSW.version);
}
if (preferencesService.prefHasUserValue("server.name"))
var preferencesService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch("answers.");
text = text.value.substring(text.selectionStart, text.selectionEnd);
if (text.length>80)
text = text.substr(0,79);
}
else
{
if (gContextMenu.searchSelected)
text = gContextMenu.searchSelected();
else
text = getBrowserSelection();
if (text.length == 0)
{
focusword = true;
text = ANSW.pointedWords;
}
else if (text.length>80)
text = text.substr(0,79);
}
if (text.length>0)
{
// urlify and encode utf8 the search string
var search = encodeURIComponent(text);
var URL = "http://" + ANSW.server + "/main/ntquery?s=" + search;
if (focusword)
{
URL += "&fw=" + ANSW.fw ;
URL += "&fc=" + ANSW.fc ;
}
URL +="&gwp=16";
ANSW.openLink(URL,null);
}
// re init
ANSW.pointedWords="";
ANSW.fw=0;
ANSW.fc=0;
};
ANSW.onClick = function(ev)
{
var altleftclick = true;
var preferencesService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch("answers.");
var preferencesService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch("answers.");
var preferencesService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch("answers.");
// If the preference is set
if(preference && preferencesService)
{
var supportsStringInterface = Components.interfaces.nsISupportsString;
var string = Components.classes["@mozilla.org/supports-string;1"].createInstance(supportsStringInterface);